<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins"
	value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品条码管理</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<script src="${Plugins}/ligerUI/js/plugins/ligerTab.js" type="text/javascript"></script>  
<script src="${Plugins}/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>

<style type="text/css">
#searchbar {
	margin-bottom: 10px;
	margin-left: 15px;
}

.navbar {
	height: 20px;
	border-bottom: #E6E6E6 solid 1px;
	line-height: 20px;
}

.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}

.inputSize {
	width: 150px;
}

select {
	width: 150px;
	font-size: 12px;
}

td {
	font-size: 12px
}
</style>
</head>
<body style="padding: 6px; overflow: hidden;">
	<div class="navbar">
		<span>您当前的位置：</span> 出入库管理 &gt;出库管理 &gt;导入条形码 &gt;查看导入失败条形码
	</div>
	<div id="tip">
	</div>
   <div id="navtab3" style="width: 100%;overflow:hidden; border:1px solid #A3C0E8; margin-top:6px;">  
        <div tabid="tab1" title="未知条形码" lselected="true"  style="height:100%" >  
			<div id="noExistsCodesGrid" style="margin: 0; padding: 0"></div>
        </div>   
        <div tabid="tab2" title="已出库条形码" style="height:100%" >  
			<div id="stockedOutCodesGrid" style="margin: 0; padding: 0"></div>
        </div>  
        <div tabid="tab3" title="正常条形码" style="height:100%" >  
			<div id="correctCodesGrid" style="margin: 0; padding: 0"></div>
        </div> 
    </div>  
</body>
<script>
	var data = window.parent.barCodeErrorData;
	var tipText = window.parent.tipText;
	var correctCodes = data.correctCodes;
	var stockedOutCodes = data.stockedOutCodes;
	var noExistsCodes = data.noExistsCodes;
	var grid = null;
	var tab = null
	$(function() {
        $("#navtab3").ligerTab({
        	onAfterSelectTabItem: function (tabid){
        		if(tabid == 'tab2'){
        			initStockedOutCodesGrid();
        		}else if(tabid == 'tab3'){
        	 		initCorrectCodesGrid();
        		}
       		} 
        });
        initNoExistsCodesGrid();
	});

	function initCorrectCodesGrid() {
		var data = {};
		data.Rows = correctCodes;
		data.Total = correctCodes == null ? 0 : correctCodes.length;

		grid = $("#correctCodesGrid").ligerGrid({
			columns : [ {
				display : '货品编号',
				name : 'prodNo'
			}, {
				display : '货品条码',
				name : 'codeNo'
			}, {
				display : '采购单号',
				name : 'purNo'
			}, {
				display : '入库单号',
				name : 'stockInNo'
			} ],
			pageSize : 30,
			width : '100%',
			height : '100%',
			data : data,
		});
	}

	function initStockedOutCodesGrid() {
		var data = {};
		data.Rows = stockedOutCodes;
		data.Total = stockedOutCodes == null ? 0 : stockedOutCodes.length;

		grid = $("#stockedOutCodesGrid").ligerGrid({
			columns : [ {
				display : '货品编号',
				name : 'prodNo'
			}, {
				display : '货品条码',
				name : 'codeNo'
			}, {
				display : '采购单号',
				name : 'purNo'
			}, {
				display : '入库单号',
				name : 'stockInNo'
			}, {
				display : '出库单号',
				name : 'stockOutNo'
			} ],
			pageSize : 30,
			width : '100%',
			height : '100%',
			data : data,
		});
	}

	function initNoExistsCodesGrid() {
		var data = {};
		data.Rows = noExistsCodes;
		data.Total = noExistsCodes == null ? 0 : noExistsCodes.length;

		grid = $("#noExistsCodesGrid").ligerGrid({
			columns : [ {
				display : '货品条码',
				name : 'codeNo'
			}, ],
			pageSize : 30,
			width : '100%',
			height : '100%',
			data : data,
		});
	}
</script>
</html>